package com.qingguatang.java5minute.control;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.PostConstruct;
import java.util.HashMap;
import java.util.Map;

@Controller
public class MusicControl {
    private static final Map<String,String> musics=new HashMap<>();

    @RequestMapping("song/music")
    @ResponseBody
    public String getMusicSrc(String songId){
        return musics.get(songId);
    }
    @PostConstruct//默认先执行
    public void init(){
        musics.put("35847388","https://m701.music.126.net/20200418160517/46eb527bfa9d660ccace17392270e9ff/jdyyaac/0e08/0509/030b/9b3f77a8fc2c7f3f18ce4a8b28a074a3.m4a");
        musics.put("19081556","https://m10.music.126.net/20200418160722/cd6e8643c76dc1aadc913f4c39fd2cc2/ymusic/4865/23d8/39cb/bffcbba5889d28a39e4e42762cea162c.mp3");
    }
}
